CURL_DIR=`pwd`

ARCH=arm
TOOLCHAIN_OHOS=/opt/toolchain-ohos
export AS=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-as
export CC="${TOOLCHAIN_OHOS}/native/llvm/bin/clang --target=${ARCH}-linux-ohos"
export CXX="${TOOLCHAIN_OHOS}/native/llvm/bin/clang++ --target=${ARCH}-linux-ohos"
export LD="${TOOLCHAIN_OHOS}/native/llvm/bin/lld --target=${ARCH}-linux-ohos"
export STRIP=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-strip
export RANLIB=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-ranlib
export OBJDUMP=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-objdump
export OBJCOPY=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-objcopy
export NM=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-nm
export AR=${TOOLCHAIN_OHOS}/native/llvm/bin/llvm-ar
export CFLAGS="-fPIC -D__MUSL__=1"
export CXXFLAGS="-fPIC -D__MUSL__=1"

set -x
pushd $CURL_DIR

rm -rf out
mkdir out


./configure --host=${ARCH} --prefix=$CURL_DIR/out --without-ssl

make clean

make

make install

popd
